package com.macro.mall.service.impl;

import com.macro.mall.mapper.CaseStyleMapper;
import com.macro.mall.model.CaseStyle;
import com.macro.mall.service.CaseStyleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CaseStyleServiceImpl implements CaseStyleService {

    @Resource
    private CaseStyleMapper caseStyleMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return caseStyleMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(CaseStyle record) {
        return caseStyleMapper.insert(record);
    }

    @Override
    public int insertSelective(CaseStyle record) {
        return caseStyleMapper.insertSelective(record);
    }

    @Override
    public CaseStyle selectByPrimaryKey(Integer id) {
        return caseStyleMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(CaseStyle record) {
        return caseStyleMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(CaseStyle record) {
        return caseStyleMapper.updateByPrimaryKey(record);
    }

    @Override
    public int batchInsert(List<CaseStyle> list) {
        return caseStyleMapper.batchInsert(list);
    }

    @Override
    public List<CaseStyle> getCaseStyleList() {
        return caseStyleMapper.getCaseStyleList();
    }

    @Override
    public int findCaseStyleNum() {
        return caseStyleMapper.findCaseStyleNum();
    }

    @Override
    public List<CaseStyle> findCaseStyleList(Integer curPage, Integer pageSize) {
        Integer skip = (curPage -1 ) * pageSize;
        return caseStyleMapper.findCaseStyleList(skip, pageSize);
    }

    @Override
    public int findStyleNameNum(String name, Integer id) {
        return caseStyleMapper.findStyleNameNum(name,id);
    }
}
